package com.prs.crm.dao.stu.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.stu.StudentDao;
import com.prs.crm.domain.student.Student;

public class StudentDaoImpl extends BaseDaoImpl<Student> implements StudentDao {

	@SuppressWarnings("unchecked")
	public List<Student> getAllstuandgrade() {
		Criteria c = this.getSession().createCriteria(Student.class);
		return c.list();
//		return (List<Student>)this.getHibernateTemplate().execute(new HibernateCallback() {
//			public Object doInHibernate(Session arg0)
//					throws HibernateException {
//				Criteria criteria = arg0.createCriteria(Student.class);
//				return criteria.list();
//			}
//			
//		});
	}

}
